package com.example.androiddemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // 初始按钮
        findViewById(R.id.lesson3).setOnClickListener(this);
        findViewById(R.id.lesson4).setOnClickListener(this);
        findViewById(R.id.lesson5).setOnClickListener(this);
        findViewById(R.id.lesson6).setOnClickListener(this);
        findViewById(R.id.lesson7).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.lesson3:
                startActivity(new Intent(this,Lesson3Activity.class));
                break;
            case R.id.lesson4:
                startActivity(new Intent(this,Lesson4Activity.class));
                break;
            case R.id.lesson5:
                startActivity(new Intent(this,Lesson5Activity.class));
                break;
            case R.id.lesson6:
                startActivity(new Intent(this,Lesson6Activity.class));
                break;
            case R.id.lesson7:
                startActivity(new Intent(this,Lesson7Activity.class));
                break;

        }

    }
}